package com.itheima.test5;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

public class Test {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>(List.of("王佳乐","张三丰", "王思聪", "张飞", "刘晓敏", "张靓颖","王敏"));
        Stream<String> stream1 = list.stream().filter(s -> s.startsWith("张"));
        Stream<String> stream2 = list.stream().filter(s -> s.startsWith("王"));
        Stream<String> concat = Stream.concat(stream1, stream2);
        concat.forEach(s -> System.out.println(s));
    }
}
